#include<func.h>

int main()
{
    int pid;
    pid=fork();
    if(0==pid)
    {
        printf("I am child\n");
        exit(NULL);

    }
    else{
        printf("I am parent\n");
        int status;
        pid=wait(&status);
        if(WIFEXITED(status))
        {
            printf("child exit code=%d\n",WEXITSTATUS(status));
        }
        else{
            printf("child crash\n");
        }
    }
    return 0;
}